<?php
/*
Overmundo, cultura de todo o Brasil
Desenvolvido pela Tecnopop para o Núcleo de Idéias Movimento
Copyright (C) 2006  Núcleo de Idéias Movimento

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

*/

header("Expires: ".gmdate("D, d M Y H:i:s")."GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-type: text/css; charset=iso-8859-1"); 

require('../lib/class.site.php');
require('../lib/class.overmundo.php');
require('../lib/class.conecta.php');

session_start();

if ($_GET["tag"]) {
	$tag = $_GET["tag"];
}

//echo "GET " . $_GET["tag"];

$minhaConexao = new Conecta();

$meuSite = new Overmundo();

$meuSite->linkid = $minhaConexao->linkid;

//unset($_SESSION["linhaTags"]);

if ($_SESSION["linhaTags"]) {
?>
<br/><span class="txt13"><strong>Suas Tags:</strong></span>&nbsp;<br/>
<?
	$currTags = explode(" ", $_SESSION["linhaTags"]);
		
	while (list(, $value) = each($currTags) ) {
		if ( ($value) && ($value != $tag) ) {
			$alterTags[] = $value;
			$resTag = $meuSite->OvermundoListaTags("tituloUnicoTag = '". $value ."'");
			if ($rowTag = mysql_fetch_array($resTag)) {
				$linkTag = "<a href='/tag/" .  $value . "' target=_blank>" . $value . "</a>";
			} else {
				$linkTag = $value;
			}
?>
			<span class="txt13"><span class="txt11"><?=$linkTag?></span></span>&nbsp;<a href="javascript:excluiLinhaTags('<?=$value?>'); void(0);"><img src="../images/apagar.gif" alt="apagar" width="11" height="13" border="0"></a>
<?php
			}	
		} // fim while
	if (count($alterTags) > 0) {
		$_SESSION["linhaTags"] = implode(" ", $alterTags);	
	} else {
		unset($_SESSION["linhaTags"]);	
	}
} // fim if	
?>